<?xml version="1.0" encoding="ISO-8859-1" ?>

<html xmlns="http://www.w3.org/1999/xhtml" 
	  xmlns:h="http://java.sun.com/jsf/html" 
	  xmlns:f="http://java.sun.com/jsf/core"
	  xmlns:p="http://primefaces.org/ui"
	  xmlns:ui="http://java.sun.com/jsf/facelets">


<h:head>

</h:head> 

<h:body>
	<ui:composition template="/template.xhtml">
		<ui:define name="conteudo">
	
				<h1><p:outputLabel value="#{msg.topico}"/> </h1>
				<h:form styleClass="formTopicoForm">
					<h:panelGrid columns="2" styleClass="painelTopicoForm">
					
						<h:outputLabel value="#{msg.disciplina} "/>
						<h:panelGroup>
							<h:inputText id="disciplina" label="#{msg.disciplina}" value="#{topicoManagedBean.disciplina.nome}" disabled="true">
								<f:validateLength maximum="60"/>
							</h:inputText>
							<h:message for="disciplina" showSummary="true" showDetail="false" />
						</h:panelGroup>		
					
						<h:outputLabel value="#{msg.titulo} "/>
						<h:panelGroup>
							<h:inputText id="titulo" label="#{msg.titulo}" value="#{topicoManagedBean.topico.titulo}" required="true">
								<f:validateLength maximum="60"/>
							</h:inputText>
							<h:message for="titulo" showDetail="false" showSummary="true"/>
						</h:panelGroup>
									
						<h:outputLabel value="#{msg.descricao}  "/>
						<h:panelGroup>
							<h:inputText id="descricao" label="#{msg.descricao}" value="#{topicoManagedBean.topico.descricao}" required="true">
								<f:validateLength maximum="300"/>
							</h:inputText>
							<h:message for="descricao" showDetail="false" showSummary="true"/>
						</h:panelGroup>
								
						<h:commandButton value="#{msg.cadastrar}" action="#{topicoManagedBean.insereTopico}"/>
						
					
					</h:panelGrid>
				</h:form>
			
		</ui:define>
	</ui:composition>
</h:body> 
     
</html>